-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Add last verified script #3154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add last verified script #3154
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/tutorials/3154
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ No FailuresAs of commit a7f8678 with merge base 9242c60 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Delete the JSON from the main branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of unrelated files in this PR (which feels like a good changes on its own)
Please do not put scripts in a top-level folder, create scripts
folder or use .jenkins
one (which imo can be renamed to scripts, as Jenkins is no longer used for tutorials CI
@@ -0,0 +1,12 @@ | |||
:orphan: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this unrelated to PR in question?
beginner_source/t5_tutorial.rst
Outdated
@@ -1,3 +1,5 @@ | |||
:orphan: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unrelated
@@ -1,3 +1,5 @@ | |||
:orphan: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks unrelated
insert_last_verified.py
Outdated
from bs4 import BeautifulSoup | ||
|
||
# Check if the build directory is provided as an argument in the Makefile | ||
if len(sys.argv) < 2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow __main__
code pattern: https://docs.python.org/3/library/__main__.html
insert_last_verified.py
Outdated
def get_creation_date(file_path): | ||
try: | ||
result = subprocess.run( | ||
["git", "log", "--diff-filter=A", "--format=%aD", "--", file_path], | ||
capture_output=True, | ||
text=True, | ||
check=True, | ||
) | ||
if result.stdout: | ||
creation_date = result.stdout.splitlines()[0] | ||
creation_date = datetime.strptime(creation_date, "%a, %d %b %Y %H:%M:%S %z") | ||
formatted_date = creation_date.strftime("%b %d, %Y") | ||
else: | ||
formatted_date = "Unknown" | ||
return formatted_date | ||
except subprocess.CalledProcessError: | ||
return "Unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like get_last_updated
and get_created
could benefit from some refactoring of common code.
And why unknown
is an accepted answer? Shouldn't it raise an exception that should be handled elsewhere?
Uh oh!
There was an error while loading. Please reload this page.